
import numpy as np
import h5py

# pywavelet

with h5py.File("timing_samples.h5", 'r') as file_in:
    hit = file_in["hit"][()]
    nonhit = file_in["nonhit"][()]

x=hit["PulseTime"]

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
import ft
# c = ft.fc(x, krange=(-100,100))
# ax.plot(c)
#xx, t = ft.fapprox(x, krange=(-10,10), threshold=0.001)
a, b, _= ax.hist(x, bins=1000)
xx, t = ft.fapprox(a, krange=(-30,30), threshold=0.001) # c_-10, ..., c_10

ax2.plot(t, np.real(xx))

plt.show()